package org.zpmis.domain.contract.service.impl;

import org.zpmis.domain.contract.dao.ContractMapper;
import org.zpmis.domain.contract.model.Contract;
import org.zpmis.domain.contract.service.ContractService;
import org.zpmis.common.service.AbstractService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.transaction.annotation.Transactional;
import org.zpmis.domain.contract.vo.ContractCountReceived;
import org.zpmis.domain.contract.vo.ContractReceived;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * Created with CodeGenerator
 * Description:
 * @author  Yang
 * Date: 2021-6-2
 * Time: 14:52:19
 */
@Service
@Transactional
public class ContractServiceImpl extends AbstractService<Contract> implements ContractService {

    @Resource
    private ContractMapper contractMapper;

    @Override
    public List<ContractReceived> getContractReceived(Long startTime, Long endTime) {
        Map<String,Object> param = new HashMap<>();
        param.put("startTime",startTime);
        param.put("endTime",endTime);
        return contractMapper.getContractReceived(param);
    }

    @Override
    public List<ContractCountReceived> getContractCountReceived(Long startTime, Long endTime) {
        Map<String,Object> param = new HashMap<>();
        param.put("startTime",startTime);
        param.put("endTime",endTime);
        return contractMapper.getContractCountReceived(param);
    }
}
